package com.my.study.feign.fallback;

import com.my.study.entity.vo.ResponseVO;
import com.my.study.feign.RoleClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 服务熔断处理,这样方式取不到错误信息(fallback = RoleFallback.class)
 */
@Component
@Slf4j
public class RoleFallback implements RoleClient {
    @Override
    public ResponseVO queryRole(String roleId) {
        return ResponseVO.fail("feign远程调用失败!");
    }

    @Override
    public ResponseVO test() {
        return ResponseVO.fail("feign远程调用失败!");
    }
}
